<template>
  <div>
    <div>
      <span @click="clickFn('/src/views/Index.vue', 'Index')">首页</span>
      <span @click="clickFn('/src/views/New.vue', 'New')">新闻</span>
      <span @click="clickFn('/src/views/Pe.vue', 'Pe')">体育</span>
    </div>
    <div>
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
export default {
  methods: {
    clickFn(path, name) {
      this.$router.push({
        // path,
        name,
      });
    },
  },
};
</script>

<style>
span {
  margin-right: 20px;
  cursor: pointer;
}
</style>